import React from 'react'
import { Link } from 'react-router-dom'
import { useSelector } from 'react-redux'

const Header = () => {
    const {isLogin} = useSelector((state) => state)
    // console.log(isLogin)
    return (
        <div style={{ height: 60, background: '#ddd' }}>
            <Link to='/'>首页</Link>
            <Link to='/about'>关于</Link>
            
            {
                isLogin
                ?<button>退出</button>
                :<Link to='/login'>登录</Link>
            }
        </div>
    )
}

export default Header
